<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSchoolsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasTable('schools')) {
            Schema::create('schools', function (Blueprint $table) {
                $table->bigIncrements('id');
                $table->string('school_name', 50)->default('')->comment('学校名称');
                $table->string('manager_name', 50)->default('')->comment('负责人');
                $table->char('mobile', 11)->comment('手机号');
                $table->string('domain_name', 50)->default('')->comment('域名');
                $table->string('company_ids', 512)->default('')->comment('供应商（配送公司）ID');
                $table->string('logo', 100)->default('')->comment('学校logo');
                $table->timestamps();
            });

            \Illuminate\Support\Facades\DB::statement('ALTER TABLE `caidj_schools` comment "学校表"');
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('schools');
    }
}
